/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package textfilewriter.entity.fact;

import java.text.SimpleDateFormat;
import java.util.Date;
import textfilewriter.entity.dimension.Customer;

/**
 *
 * @author GiangLT
 */
public class VoiceUsage {

    private Date startDate;
    private Date endDate;
    private Customer customer;
    private String network;
    private String networkType;
    private long duration;
    private double fee;
    private double voiceArpu;
    private int customerBasePenetration;
    private String channel;
    private String location;
    private static final String WIRELESS = "Wireless";
    private static final String WIRELINE = "Wireline";

    public VoiceUsage() {
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public int getCustomerBasePenetration() {
        return customerBasePenetration;
    }

    public void setCustomerBasePenetration(int customerBasePenetration) {
        this.customerBasePenetration = customerBasePenetration;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public double getFee() {
        return fee;
    }

    public void setFee(double fee) {
        this.fee = fee;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getNetwork() {
        return network;
    }

    public void setNetwork(String network) {
        this.network = network;
    }

    public String getNetworkType() {
        return networkType;
    }

    public void setNetworkType(String networkType) {
        this.networkType = networkType;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public double getVoiceArpu() {
        return voiceArpu;
    }

    public void setVoiceArpu(double voiceArpu) {
        this.voiceArpu = voiceArpu;
    }

    @Override
    public String toString() {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        StringBuilder sb = new StringBuilder();
        sb.append(dateFormat.format(startDate));
        sb.append("|");
        sb.append(dateFormat.format(endDate));
        sb.append("|");
        sb.append(customer.getCustFirstName());
        sb.append(" ");
        sb.append(customer.getCustLastName());
        sb.append("|");
        sb.append(customer.getCustStreetAddress());
        sb.append("|");
        sb.append(customer.getCustCity());
        sb.append("|");
        sb.append(customer.getCustIncomeLevel());
        sb.append("|");
        sb.append(networkType);
        sb.append("|");
        sb.append(network);
        sb.append("|");
        sb.append(duration);
        sb.append("|");
        sb.append(fee);
        sb.append("|");

        return sb.toString();
    }

    public String getHeader() {
        return "Start date|End date|Customer name|Customer Address|City|Income Level|Wireless/Wireline|Network|Duration|Fee";
    }
}
